<template>
	<view class="beijingse">
		<view class="u-demo-block">
			<u-swiper :list="list6" @change="e => currentNum = e.current" :autoplay="false" indicatorStyle="right: 20px"
				height="375" imgMode="aspectFit " indicator indicatorMode="line">
				<view slot="indicator" class="indicator-num">
					<text class="indicator-num__text">{{ currentNum + 1 }}/{{ list6.length }}</text>
				</view>
			</u-swiper>
		</view>
		<view class="mainpadding">
			<view class=" mainpadding ffffff radius">
				<view class="flexbetween">
					<view class="ershib">{{dataAll.title}}</view>
					<view class="huangsetext">{{dataAll.token_price}}通证</view>
				</view>
				<view class="margin_top ershil">{{dataAll.des}}</view>
			</view>
			<view class="mainpadding ffffff radius margin_top">
				<view class="ershib">投资详情</view>
				<view class="ershil margin_top">
					<u-parse :content="dataAll.content"></u-parse>
				</view>
			</view>
		</view>
		<!-- 固定底部 -->
		<view class="mainpadding" @click="tzmr">
			<view class="bigbtn">立即投资</view>
		</view>
	</view>
</template>


<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				listid: "",
				dataAll: {
					ontent: "",
					day: "",
					des: "",
					id: 1,
					image: "",
					image_text: "",
					images: "",
					rate: 4,
					status: "",
					status_text: "",
					stock: "",
					title: "",
					token_price: "",
					weigh: 0,
				},
				currentNum: 0,
				list6: []
			}
		},
		onLoad(options) {
			this.listid = options.id
		},
		onShow() {
			this.init()
		},
		methods: {
			init() {
				let _this = this;
				httpRequest.request('/api/styc/stycDetail', 'POST', {
					id: this.listid
				}, false, false, true).then(res => {
					if (res.code == 1) {
						this.dataAll = res.data
						this.list6 = res.data.images_text
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			tzmr() {
				if (!httpRequest.checkIsLogin()) {
					uni.navigateTo({
						url:"/pages/login/zhanghmmdl"
					})
					return
				}
				uni.navigateTo({
					url: '/pages/homepage/mairu?id=' + this.dataAll.id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.huangsetext {
		font-size: 28rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #FAB536;
	}

	.ershib {
		font-size: 28rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #000000;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.indicator {
		@include flex(row);
		justify-content: center;

		&__dot {
			height: 6px;
			width: 6px;
			border-radius: 100px;
			background-color: rgba(255, 255, 255, 0.35);
			margin: 0 5px;
			transition: background-color 0.3s;

			&--active {
				background-color: #ffffff;
			}
		}
	}

	.indicator-num {
		padding: 2px 0;
		background-color: rgba(0, 0, 0, 0.35);
		border-radius: 100px;
		width: 35px;
		@include flex;
		justify-content: center;

		&__text {
			color: #FFFFFF;
			font-size: 12px;
		}
	}
</style>
